<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	
	

<title>Insert title here</title>
</head>
<body>
	<form action="crudOrder.do" method="Get" autocomplete="on">
		<table>	
			<tr>
				<td>
					Tìm kiếm tên khách hàng:
				</td>
				
				<td>
					<input type="text" name="search"/>
				</td>
				
				<td>
					
					<input type="submit" name="btnSearch" value="seach"/>
				</td>
			</tr>
		</table>
	</form>
	
	<br/>
	<h4>Danh sách những order</h4>
	
	<table width="100%" border="1">
		<tr>
			<td>ID</td>
			<td>Order Date</td>
			<td>Note</td>
			<td>Customer's Name</td>
			<td>Address</td>
			<td>State</td>
			<td></td>
		</tr>
		
		<c:forEach var="s" items="${entityOrder}">
			<tr>
				<td>${s.id}</td>
				<td>${s.orderDate }</td>
				<td>${s.note}</td>
				<td>${s.customer.name}</td>
				<td>${s.address}</td>
				<td><c:choose>
						<c:when test="${s.state == false}">
							<a href="crudOrder.do?orderid=${s.id}&duyet=ok">Duyệt</a>
						</c:when>
					
						<c:otherwise>
			  				Đã duyệt
						</c:otherwise>
					</c:choose></td>				
				<td><a href="crudOrderDetail.do?orderid=${s.id}">Chi tiết</a></td>
			</tr>
		</c:forEach>
	</table>
</body>
</html>